package com.fancy.learncenter.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.andview.refreshview.XRefreshView;
import com.fancy.learncenter.adapter.OrderAdapter;
import com.fancy.learncenter.adapter.ToothTZAdapter;
import com.superservice.lya.R;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

public class OrderFragment extends Fragment {

    @Bind(R.id.xRefreshView)
    XRefreshView xRefreshView;
    @Bind(R.id.recycleView)
    RecyclerView recycleView;

    ArrayList<String> mData;

    public OrderFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_tooth_list, container, false);
        ButterKnife.bind(this, view);
        initView();
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    private void initView() {
        mData = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            mData.add(" ");
        }
        xRefreshView.setPullRefreshEnable(false);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recycleView.setLayoutManager(linearLayoutManager);
        OrderAdapter adapter = new OrderAdapter(getActivity(), mData);
        recycleView.setAdapter(adapter);
    }
}
